package com.sainan114.pipelinestudy.mapper;

import com.sainan114.pipelinestudy.model.PipelineDO;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author lgb
 * @Date: 2021/7/9
 */
@Mapper
public interface PipelineMapper {
    @Select("select pipeline_name, strategy_rule  from pipeline_rule where pipeline_name = #{pipelineName} and is_del != 'Y'")
    @Results({
            @Result(column = "pipeline_name", property = "pipelineName"),
            @Result(column = "strategy_rule", property = "strategyRule")
    })
    PipelineDO queryByPipelineName(@Param("pipelineName") String pipelineName);

    @Select("select *  from pipeline_rule")
    @Results({
            @Result(column = "pipeline_name", property = "pipelineName"),
            @Result(column = "strategy_rule", property = "strategyRule")
    })
    List<PipelineDO> queryAll();

}
